//
//  step_yuan.m
//  测试进度条
//
//  Created by 唐康 on 16/5/4.
//  Copyright © 2016年 唐康. All rights reserved.
//

#import "step_yuan.h"
#import "yuan2_sc.h"
#import "yuan2_zj.h"
@implementation step_yuan

-(void)awakeFromNib{
    [self setchushihua];
}

//代码创建初始化
-(id)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    [self setchushihua];
    return  self;
}

-(void)setchushihua{
    _kd = 20;
    _sc = [[yuan2_sc alloc]init];
    _sc.backgroundColor = [UIColor clearColor];
    _zj = [[yuan2_zj alloc]init];
    _zj.backgroundColor = [UIColor clearColor];
    // _led_jishu = [[led_jishu alloc ]init];
    // _led_jishu.backgroundColor = [UIColor clearColor];
    [self insertSubview:_zj atIndex:1];
    [self insertSubview:_sc atIndex:2];
}


//重绘方法
-(void)drawRect:(CGRect)rect{
    
    [self draw_scdcdt:rect];
    // [self draw_jishu:rect];
    
}



//添加上层,中间层，底层
-(void)draw_scdcdt:(CGRect)rect{
    _sc.frame = rect;
    _zj.frame = rect;
    //宽度，值，宽度
    _sc.sc_kd = _kd+5;
    _zj.z = _z;
    _zj.zj_kd = _kd;
}



-(void)setKd:(float)kd{
    _kd = kd>20?20:kd;
    [self setNeedsDisplay];
}
-(void)setZ:(float)z{
    _z = z;
    [self setNeedsDisplay];
}


@end
